<?php
/**
* @version 1.0.0
* @package RSSearch! 1.0.0
* @copyright (C) 2011 www.rsjoomla.com
* @license GPL, http://www.gnu.org/licenses/gpl-2.0.html
*/

defined( '_JEXEC' ) or die( 'Restricted access' );


// Get a new installer
$plg_installer = new JInstaller();

$db = JFactory::getDBO();

function isJ16(){
	$jversion = new JVersion();
	$current_version =  $jversion->getShortVersion();
	return (version_compare('1.6.0', $current_version) <= 0);
}

if(isJ16()){
	$db->setQuery("SELECT id FROM #__extensions WHERE `folder`='rssearch' AND `type`='plugin'");
}else{
	$db->setQuery("SELECT id FROM #__plugins WHERE `folder`='rssearch'");
}

$plg_ids = (array)$db->loadResultArray();

foreach($plg_ids as $plg_id){
	if ($plg_id)
		$plg_installer->uninstall('plugin', $plg_id);
}
?>
<p><strong>RSSearch! 1.0.0 uninstalled</strong></p>
<table class="adminlist">
	<thead>
		<tr>
			<th class="title" colspan="2"><?php echo JText::_('Extension'); ?></th>
			<th width="30%"><?php echo JText::_('Status'); ?></th>
		</tr>
	</thead>
	<tfoot>
		<tr>
			<td colspan="3"></td>
		</tr>
	</tfoot>
	<tbody>
		<tr class="row0">
			<td class="key" colspan="2"><?php echo 'RSSearch! '.JText::_('Component'); ?></td>
			<td><strong><?php echo JText::_('Removed'); ?></strong></td>
		</tr>
		<tr>
			<th><?php echo JText::_('Plugin'); ?></th>
			<th><?php echo JText::_('Group'); ?></th>
			<th></th>
		</tr>
		<tr class="row1">
			<td class="key">RSSearch! - Content</td>
			<td class="key">rssearch</td>
			<td><strong><?php echo JText::_('Removed'); ?></strong></td>
		</tr>
		<tr class="row0">
			<td class="key">RSSearch! - RSEvents!</td>
			<td class="key">rssearch</td>
			<td><strong><?php echo JText::_('Removed'); ?></strong></td>
		</tr>
		<tr class="row1">
			<td class="key">RSSearch! - Kunena</td>
			<td class="key">rssearch</td>
			<td><strong><?php echo JText::_('Removed'); ?></strong></td>
		</tr>
<?php 
if(!isJ16())
{
?>
		<tr class="row1">
			<td class="key">RSSearch! - RSMembership!</td>
			<td class="key">rssearch</td>
			<td><strong><?php echo JText::_('Removed'); ?></strong></td>
		</tr>
		<tr class="row0">
			<td class="key">RSSearch! - K2</td>
			<td class="key">rssearch</td>
			<td><strong><?php echo JText::_('Removed'); ?></strong></td>
		</tr>
		<tr class="row0">
			<td class="key">RSSearch! - Virtuemart</td>
			<td class="key">rssearch</td>
			<td><strong><?php echo JText::_('Removed'); ?></strong></td>
		</tr>
<?php
}
?>
		<tr class="row0">
			<td colspan="2" class="key"><strong>Module RSSearch!</strong></td>
			<td><strong><?php echo JText::_('Removed'); ?></strong></td>
		</tr>
		<tr class="row0">
			<td colspan="2" class="key"><strong>Component RSSearch!</strong></td>
			<td><strong><?php echo JText::_('Removed'); ?></strong></td>
		</tr>
	</tbody>
</table>